package org.test;

import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class test2 {

    public static void main(String[] args) {

        Scanner in = new Scanner(System.in);

        //String str="abc def efg";
        String str=in.nextLine();

        re5(str);

    }

    public static char[] re(String s){

        char[] chars=s.toCharArray();

        char[] chars1=new char[s.length()];

        for(int i=chars.length-1,j=0;i>=0;i--,j++){
            chars1[j]=chars[i];
        }

        return chars1;

    }

    public static String re2(String s){

        char[] chars=s.toCharArray();

        char[] chars1=new char[s.length()];

        StringBuilder stringBuilder=new StringBuilder();
        StringBuilder stringBuilder2=new StringBuilder();
        StringBuilder stringBuilder3=new StringBuilder();

        for (int i=0;i<chars.length;i++){
            if (chars[i]>='a'&&chars[i]<='z'){
                stringBuilder.append(chars[i]);
            }else if (chars[i]>='0'&&chars[i]<='9'){
                stringBuilder2.append(chars[i]);
            }else {
                stringBuilder3.append(chars[i]);
            }
        }

        return stringBuilder2.append(stringBuilder3.append(stringBuilder.toString()).toString()).toString();

//        for(int i=chars.length-1,j=0;i>=0;i--,j++){
//            chars1[j]=chars[i];
//        }
//
//        return chars1;

    }

    public static void re3(String s){

        char[] chars=s.toCharArray();

        char temp=' ';

        for (int i=0;i<chars.length-1;i++){
            for (int j=i+1;j< chars.length;j++){
                if (chars[i]>chars[j]){
                    temp=chars[i];
                    chars[i]=chars[j];
                    chars[j]=temp;
                }

            }

        }

        for (int i=0;i<chars.length;i++){
            System.out.print(chars[i]);
        }

    }

    public static void re4(String s){

        int m=s.length();
        int[] count=new int[26];
        for (int i=0;i<m;i++){
            count[s.charAt(i)-'a']++;
        }

        char temp=' ';

        StringBuilder stringBuilder=new StringBuilder();
        for (int j=0;j<m;j++){
//            if (temp==s.charAt(j)){
//                continue;
//            }
            if (count[s.charAt(j)-'a']==0){
                continue;
            }
            stringBuilder.append(s.charAt(j));
            stringBuilder.append(count[s.charAt(j)-'a']);
            count[s.charAt(j)-'a']=0;
            //temp=s.charAt(j);
        }

        System.out.println(stringBuilder);


    }

    public static void re5(String s){

        String[] result=s.split(" ");

        List<String> list=new ArrayList<>();

        char temp=' ';

        for (String str:result){

            char[] chars=str.toCharArray();
            for(int i=chars.length-1,j=0;i>=(chars.length/2);i--,j++){
                temp=chars[i];
                chars[i]=chars[j];
                chars[j]=temp;
            }
            list.add(String.valueOf(chars));
        }

        StringBuilder stringBuilder=new StringBuilder();

        for (int i=0;i<list.size();i++){
            if (i==list.size()-1){
                stringBuilder.append(list.get(i));
                break;
            }
            stringBuilder.append(list.get(i)+' ');
        }

        System.out.println(stringBuilder);

    }


}

class SingleDemo{

    private static SingleDemo singleDemo=null;

    private SingleDemo(){

    }

    public synchronized static SingleDemo getInstance(){
        if (singleDemo==null){
                if (singleDemo==null){
                    singleDemo=new SingleDemo();
                }

        }
        return singleDemo;
    }

}
